package pay

import (
	"go_payment/app/param_model"
)

type AlipayF2F struct {
	Base
}

func NewAlipayF2F() *AlipayF2F {
	return new(AlipayF2F)
}

func (this *AlipayF2F) Pay(trade param_model.Trade) (*DTO, error) {
	oRet, err := this.AddOrder(trade)
	if err != nil {
		return nil, err
	}
	ret := DTO{
		TransId: oRet.OrderId,
	}
	return &ret, nil
}

func (this *AlipayF2F) Notify() error {
	err := this.HandlerOrder("2020091518232117514575798671")
	if err != nil {
		return err
	} else {
		return nil
	}
}

func (this *AlipayF2F) Callback() {

}
